@extends('layout.adminlayout')
@section('css')
<script src="/admin/js/metisMenu.min.js"></script>
<script src="/admin/js/custom.js"></script>
<link href="/admin/css/custom.css" rel="stylesheet">
@endsection
@section('content')
<div class="tables">
   <div class="table-responsive bs-example widget-shadow">
      <input type="hidden" id="agentId" value="{{Cookie::get('agentId')}}">
      <h4>代理商列表 :</h4>
      <table class="table table-bordered" >
         <thead>
            <tr pid='{{Cookie::get('agentId')}}'>
               <th style="text-align: center">代理商编号</th>
               <th style="text-align: center">代理商名称</th>
            </tr>
         </thead>
         <tbody>
         @if(!null==$data)
            @foreach($data as $v)
               <tr pid="{{$v['pid']}}" id="{{$v['id']}}">
                  <th scope="row" style="text-align: center">{{$v['id']}}</th>
                  <td>{!! $v['agent_name'] !!}</td>
               </tr>
            @endforeach
         @endif
         </tbody> 
      </table>
   </div>
</div>
{{--<script>
   var agentId = $('#agentId').val();
   $('tr[pid!='+agentId+']').hide();
   $('tr').click(function () {
       var id = $(this).attr('id')
       $('tr[pid='+id+']').toggle();
   })
</script>--}}
@endsection